package cn.miw.android.bdmp3.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias("url")
public class ASongUrl {
	private String encode;
	private String decode;
	private String type;
	private long lrcid = 0;
	private int flag;

	public String getTrueURL() {
		int pos = encode.lastIndexOf("/");
		String preURL = (pos > 0) ? encode.substring(0, pos) : encode;
		return preURL + "/" + decode;
	}

	public String getLrcURL() {
		String url = "";
		if (lrcid != 0) {
			url = "http://box.zhangmen.baidu.com/bdlrc/" + (lrcid / 100) + "/" + lrcid + ".lrc";
		}
		return url;
	}

	public String getEncode() {
		return encode;
	}

	public void setEncode(String encode) {
		this.encode = encode;
	}

	public String getDecode() {
		return decode;
	}

	public void setDecode(String decode) {
		this.decode = decode;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public long getLrcid() {
		return lrcid;
	}

	public void setLrcid(long lrcid) {
		this.lrcid = lrcid;
	}

	public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	@Override
	public String toString() {
		return "ASongUrl [encode=" + encode + ", decode=" + decode + ", type=" + type + ", lrcid=" + lrcid + ", flag=" + flag + "]";
	}

}
